<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="base_top.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>个人中心</title>
	<%@ include file="base_head.jsp" %>
	<link type="text/css" rel="stylesheet" href="<%=basePath%>css/user/style.css">
    <link type="text/css" rel="stylesheet" href="<%=basePath%>css/user/self_style.css">
    <style type="text/css">
    .top_ul {
    	list-style:none;
    	margin: 0px;
    	padding: 0px;
    }
    .top_ul li {
    	float: left;
		height: 30px;
		padding: 0 2px;
    }
    </style>
    <script type="text/javascript" src="<%=basePath%>js/jquery-1.12.3.js"></script>
    <script type="text/javascript">
	    function getCookie(c_name) {
		    if (document.cookie.length>0){
		      c_start=document.cookie.indexOf(c_name + "=");
		      if (c_start!=-1){ 
		        c_start=c_start + c_name.length+1;
		        c_end=document.cookie.indexOf(";",c_start);
		        if (c_end==-1) c_end=document.cookie.length;
		        return unescape(document.cookie.substring(c_start,c_end));
		      } 
	      	}
	    	return "";
	    }
	    function setCookie(c_name,value,expiredays) {
	    	var exdate=new Date();
	    	exdate.setDate(exdate.getDate()+expiredays);
	    	document.cookie=c_name+ "=" +escape(value)+
	    	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	    }
	    function checkCookie() {
	    	username=getCookie('username');
	    	if (username!=null && username!="") {
	    		alert('Welcome again '+username+'!');
	    	}
	    	else {
	      		username=prompt('Please enter your name:',"");
	      		if (username!=null && username!="") {
	        		setCookie('username',username,365);
	        	}
	      	}
	    }
	    function clearCookie(name) {  
	        setCookie(name, "", -1);  
	    }
	    function clearCookies(names) {
	    	for (var i = 0; i<names.length; i++) {
	    		setCookie(names[i]);
	    	}
	    }
	    
    	$(function() {
    		var ck = new Array("lAlias", "lName", "lPass");
    		
    		var lAlias = getCookie("lAlias");
    		var lName = getCookie("lName");
    		var lPass = getCookie("lPass");
    		
    		var full = lAlias != "" && lName != "" && lPass != "";
    		if (full) {
    			$.ajax({
        			cache: false,
        			url:"log/keepLogin",
        			type: "GET",
        			data: {lalias: lAlias, luser: lName, lpass: lPass},
        			dataType:"json",
        		    success: function(data) {
        		    	setCookie('lAlias',data.lAlias,1);
        		    	setCookie('lName',data.lName,1);
        		    	setCookie('lPass',data.lPass,1);
						$("top_login").empty();
						$("top_login").append("<a href=''>" + data.lAlias + "</a>" + "    " + "<a href=''>退出</a>");
						$("#my_jpw").attr("href", "selfCenter");
        		    },
    				error: function() {
    					$("#top_login").empty();
    					$("#top_login").append("<a href='user/login.jsp'>请登录</a>");
    					clearCookies(ck);
    				}
        		});
    		} else {
    			$("#top_login").empty();
				$("#top_login").append("<a href='user/login.jsp'>请登录</a>" + "    " + "<a href='user/reg/register.jsp'>注册</a>");
				$("#my_jpw").attr("href", "user/login.jsp");
				clearCookies(ck);
    		}
    	});
    
    
    </script>
  </head>

  <body>
<!--topbar开始-->
<div class="topbar">
    <div class="topbar_center">
        <div class="topbar_left">
            <div class="topbar_left_nav">
                <ul>
                    <li><a href="JavaScript:void(0);">中华精品网首页</a></li>
                </ul>
            </div>
            <div><font>&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="JavaScript:void(0);" id="my_jpw">我的精品网</a></div>


        </div>
        <div class="topbar_right">
	     <ul class="top_ul">
	     	<li id="top_login"></li>
	     	<li class="space">|</li>
	     	<li class="space"></li>
	     	<li class="space"></li>
	     	<li class="space"></li>
	     	<li class="space"></li>
	     	<li><a href="JavaScript:void(0);">联系我们 </a></li>
	     </ul>
        </div>
    </div>

</div>
<!--topbar结束-->
<div id="wrap">
    <!--search开始-->
    <%@ include file="selfCenter_search.html" %>
    <!--search结束-->
    
    
    <%@ include file="selfCenter_menu.html" %>
    
    <!--右边个人信息开始-->
    <div class="selfinfo">


        <div class="selfinfo_detail">
            <div class="selfinfo_detail_img">
                <img src='<s:property value="#request.userPic"/>'>
            </div>
            <div class="selfinfo_detail_content">
                <div class="con_name"><s:property value="#request.userName"/></div>
                <div class="con_rank">铜牌会员</div>
                <div class="con_safe">账户安全</div>
                <div class="con_img">我的勋章</div>
            </div>
        </div>


        <div class="selfinfo_money">
            <ul>
                <li>
                    <div class="selfinfo_money_img">
                        <img src="<%=basePath%>images/selfcenter/wait-pay.png">
                    </div>
                    <div class="selfinfo_money_content">
                        <div class="money"><a href="order/orderList?orderType=wait_pay">待付款</a> </div>
                        <div class="num"><s:property value="#request.orderNum[0]"/></div>
                    </div>
                </li>
                <li>
                    <div class="selfinfo_money_img">
                        <img src="<%=basePath%>images/selfcenter/wait-goods.png">
                    </div>
                    <div class="selfinfo_money_content">
                        <div class="money"><a href="order/orderList?orderType=wait_goods">待收货</a> </div>
                        <div class="num"><s:property value="#request.orderNum[1]"/></div>
                    </div>
                </li>
                <li>
                    <div class="selfinfo_money_img">
                        <img src="<%=basePath%>images/selfcenter/wait-comment.png">
                    </div>
                    <div class="selfinfo_money_content">
                        <div class="money"><a href="order/orderList?orderType=wait_comment">待评价</a> </div>
                        <div class="num"><s:property value="#request.orderNum[2]"/></div>
                    </div>
                </li>
                <li>
                    <div class="selfinfo_money_img">
                        <img src="<%=basePath%>images/selfcenter/wait-get.png">
                    </div>
                    <div class="selfinfo_money_content">
                        <div class="money"><a href="JavaScript:void(0);">待自提</a> </div>
                        <div class="num"><s:property value="#request.orderNum[3]"/></div>
                    </div>
                </li>
            </ul>
        </div>


    </div>
    <!--右边个人信息结束-->

    <div class="bookmain">
        <!--主信息的左部分开始-->
        <div class="bookmain_book">
            <!--右边我的订单开始-->
            <div class="mybook">
                <div class="my_common_title">
                    <div class="my_common_title_books"><a href="order/orderList?orderType=all">我的订单</a> </div>
                    <div class="my_common_title_all"><a href="order/orderList?orderType=all">查看全部订单</a></div>
                    <table>
                    <s:iterator value="#request['myorder']" id="order">
                    <tr class="mybook_table_tr">
                            <td class="mybook_table_img">
                            	<s:set value="#request.order.goodsOrder.size()" id="goodsOrderSize"/>
                            	<s:if test="#goodsOrderSize > 2">
                            	<a href='goods/goodsDetail?id=<s:property value="#request.order.goodsOrder[0].goodsNum"/>' target="_blank"><img src='<s:property value="#request.order.goodsOrder[0].gaPath"/>'></a>
                                <a href='goods/goodsDetail?id=<s:property value="#request.order.goodsOrder[1].goodsNum"/>' target="_blank"><img src='<s:property value="#request.order.goodsOrder[1].gaPath"/>'></a>
                            	<a href='JavaScript:void(0);' target="_blank"><img src='<%=basePath%>images/etc.png'></a>
                            	</s:if>
                            	<s:elseif test="#goodsOrderSize > 1">
                            	<a href='goods/goodsDetail?id=<s:property value="#request.order.goodsOrder[0].goodsNum"/>' target="_blank"><img src='<s:property value="#request.order.goodsOrder[0].gaPath"/>'></a>
                                <a href='goods/goodsDetail?id=<s:property value="#request.order.goodsOrder[1].goodsNum"/>' target="_blank"><img src='<s:property value="#request.order.goodsOrder[1].gaPath"/>'></a>
                            	</s:elseif>
                            	<s:else>
                            	<a href='goods/goodsDetail?id=<s:property value="#request.order.goodsOrder[0].goodsNum"/>' target="_blank"><img src='<s:property value="#request.order.goodsOrder[0].gaPath"/>'></a>
                            	</s:else>
                            </td>
                            <td class="mybook_table_name"><a href="JavaScript:void(0);"> <s:property value="#request.order.orderInfo.orderConsignee"/></a></td>
                            <td class="mybook_table_price"><a href="JavaScript:void(0);">￥<s:property value="#request.order.orderInfo.goodsAmount"/> &nbsp;&nbsp;<s:property value="#request.order.orderInfo.orderPayWay"/></a> </td>
                            <td class="mybook_table_time"><a href="JavaScript:void(0);"><s:property value="#request.orderInfo.orderCreatTime.toString().substring(0, 19)"/> </a> </td>
                            <td class="mybook_table_wait">
                            <a href="JavaScript:void(0);">
                            <s:if test="#request.order.orderInfo.orderState == 3">
                            	等待收货
                            </s:if>
                            <s:elseif test="#request.orderInfo.orderState == 4">
                            	等待评价
                            </s:elseif>
                            <s:elseif test="#request.orderInfo.orderPayState == 0">
                            	等待付款
                            </s:elseif>
                            </a> 
                            </td>
                            <td class="mybook_table_look"><a href="#">查看</a> </td>
                        </tr>
                    </s:iterator>
                    </table>
                </div>
            </div>
            <!--右边我的订单结束-->
            <!--右边买什么开始-->
            <s:set value="#request.buyWhatMap" id="buyWhat"/>
            <div class="buy">
                <div class="my_common_title">
                    <div class="my_common_title_books"><a href="#">买什么</a> </div>
                    <div class="my_common_title_all"><a href="#">查看更多商品专辑</a> </div>
                </div>
                <div class="buy_div">
                    <div class="my_common_title">
                        <div class="my_common_title_books"><a href="JavaScript:void(0);"><s:property value="#request.buyWhat['0020201'][0].userName"/></a></div>
                    </div>
                    <div class="buy_div_bigimg">
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020201'][0].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020201'][0].mainpic"/>'></a>
                    </div>
                    <div class="buy_div_smallimg">
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020201'][1].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020201'][1].mainpic"/>'></a>
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020201'][2].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020201'][2].mainpic"/>'></a>
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020201'][3].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020201'][3].mainpic"/>'></a>
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020201'][4].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020201'][4].mainpic"/>'></a>
                    </div>
                </div>
                <div class="buy_div">
                    <div class="my_common_title">
                        <div class="my_common_title_books"><a href="JavaScript:void(0);"><s:property value="#request.buyWhat['0020202'][0].userName"/></a></div>
                    </div>
                    <div class="buy_div_bigimg">
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020202'][0].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020202'][0].mainpic"/>'></a>
                    </div>
                    <div class="buy_div_smallimg">
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020202'][1].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020202'][1].mainpic"/>'></a>
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020202'][2].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020202'][2].mainpic"/>'></a>
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020202'][3].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020202'][3].mainpic"/>'></a>
                        <a href='goods/goodsDetail?id=<s:property value="#request.buyWhat['0020202'][4].goodsNum"/>' target="_blank"><img src='<s:property value="#request.buyWhat['0020202'][4].mainpic"/>'></a>
                    </div>
                </div>
            </div>
            <!--右边买什么结束-->
            <!--我关注的商品开始-->
            <div class="mybook">
                <div class="my_common_title">
                    <div class="my_common_title_books"><a href="collect/collectGoodsList">我关注的商品</a> </div>
                    <div class="my_common_title_all"><a href="collect/collectGoodsList">查看更多</a> </div>
                </div>
                <s:iterator value="#request['mycollect']" id="collect">
                <div class="mybook_con">
                    <a href='goods/goodsDetail?id=<s:property value="#request.collect.goodsNum"/>' target="_blank"><img src='<s:property value="#request.collect.mainpic"/>'></a>
                    <div class="mybook_con_title">￥<s:property value="#request.collect.goodsPrice"/></div>
                </div>
                </s:iterator>
            </div>
            <!--我关注的商品结束-->
        </div>
        <!--主信息的左部分结束-->
        <!--主信息的右部分开始-->
        <s:set value="#request.vipRecMap" id="vipRec"/>
        <div class="right_vip">
            <div class="my_common_title_books">推荐会员</div>
            <div class="right_vip_vip">标题一</div>
            <div class="right_vip_vip">标题二</div>
            <div class="right_vip_ad">
                <a href='goods/goodsDetail?id=<s:property value="#request.vipRec['0020103'].apGoodNum"/>' target="_blank"><img src='<s:property value="#request.vipRec['0020103'].apPath"/>'></a>
                <a href='goods/goodsDetail?id=<s:property value="#request.vipRec['0020104'].apGoodNum"/>' target="_blank"><img src='<s:property value="#request.vipRec['0020104'].apPath"/>'></a>
                <a href='goods/goodsDetail?id=<s:property value="#request.vipRec['0020105'].apGoodNum"/>' target="_blank"><img src='<s:property value="#request.vipRec['0020105'].apPath"/>'></a>
                <a href='goods/goodsDetail?id=<s:property value="#request.vipRec['0020106'].apGoodNum"/>' target="_blank"><img src='<s:property value="#request.vipRec['0020106'].apPath"/>'></a>
            </div>
            <div class="production">
            	<s:set value="#request.recWorkMap" id="recWork"/>
                <div class="pro_line"></div>
                <div class="pro_title">推荐作品&nbsp;&nbsp;&nbsp;&nbsp;/</div>
                <div class="pro_content">
                    <ul>
                        <li>
                            <a href='goods/goodsDetail?id=<s:property value="#request.recWork['0020301'].goodsNum"/>' target="_blank">
                                <div class="pro_con_back">
                                    <div class="pro_back_img"><img src='<s:property value="#request.recWork['0020301'].gaPath"/>'> </div>
                                    <div class="pro_back_con">
                                        <div class="pro_back_con_title"><s:property value="#request.recWork['0020301'].goodsName"/></div>
                                        <div class="pro_back_con_text"><s:property value="#request.recWork['0020301'].userName"/>&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#request.recWork['0020301'].skName"/></div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href='goods/goodsDetail?id=<s:property value="#request.recWork['0020302'].goodsNum"/>' target="_blank">
                                <div class="pro_con_back">
                                    <div class="pro_back_img"><img src='<s:property value="#request.recWork['0020302'].gaPath"/>'> </div>
                                    <div class="pro_back_con">
                                        <div class="pro_back_con_title"><s:property value="#request.recWork['0020302'].goodsName"/></div>
                                        <div class="pro_back_con_text"><s:property value="#request.recWork['0020302'].userName"/>&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#request.recWork['0020302'].skName"/></div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href='goods/goodsDetail?id=<s:property value="#request.recWork['0020303'].goodsNum"/>' target="_blank">
                                <div class="pro_con_back">
                                    <div class="pro_back_img"><img src='<s:property value="#request.recWork['0020303'].gaPath"/>'> </div>
                                    <div class="pro_back_con">
                                        <div class="pro_back_con_title"><s:property value="#request.recWork['0020303'].goodsName"/></div>
                                        <div class="pro_back_con_text"><s:property value="#request.recWork['0020303'].userName"/>&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#request.recWork['0020303'].skName"/></div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href='goods/goodsDetail?id=<s:property value="#request.recWork['0020304'].goodsNum"/>' target="_blank">
                                <div class="pro_con_back">
                                    <div class="pro_back_img"><img src='<s:property value="#request.recWork['0020304'].gaPath"/>'> </div>
                                    <div class="pro_back_con">
                                        <div class="pro_back_con_title"><s:property value="#request.recWork['0020304'].goodsName"/></div>
                                        <div class="pro_back_con_text"><s:property value="#request.recWork['0020304'].userName"/>&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#request.recWork['0020304'].skName"/></div>
                                    </div>
                                </div>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>

        </div>
        <!--主信息的右部分结束-->
        <!--底部广告开始-->
        <%@ include file="selfCenter_bottom_seven-ad.html" %>
        <!--底部广告结束-->
    </div>

</div>
</body>
</html>
